<template>
  <div>
    <swiper :lists="bannerList"/>
    <title-more title="全部电视" :category-id="2"/>
    <video-list :lists="hotList"/>
  </div>
</template>

<script>
import movieApi from "@/api/home/televisionFont";
import Swiper from '@/components/swiper/index'
import TitleMore from '@/components/titleMore/index'
import VideoList from '@/components/videoList/index'
export default {
  name: "television",
  components: {
    Swiper,
    TitleMore,
    VideoList
  },
  data() {
    return {
      bannerList: [],
      hotList: [],
    };
  },
  created() {
    this.getBannerList();
    this.getHotList();
  },
  methods: {
    async getBannerList() {
      let res = await movieApi.getBanner();
      if (res.code === 20000) {
        this.bannerList = res.data.data;
      } else {
        this.$toast(res.msg);
      }
    },
    async getHotList() {
      let res = await movieApi.getHot();
      if (res.code === 20000) {
        this.hotList = res.data.data;
      } else {
        this.$toast(res.msg);
      }
    },
  },
};
</script>

<style lang="scss" scoped>

.more {
  width: 100%;
  height: 0.8rem;
  padding: 0 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.3rem;
  .all-title {
    width: 80px;
    text-align: center;
    border-left: 3px solid #9fc6ff;
  }
}

</style>